/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { TreeDataModel } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface BasPurorg extends BasicModel<BasPurorg> {
  viewCode?: string; // 采购组织编码
  name?: string; // 采购组织名称
  pkCorp?: string; // 所属公司主键
}

export const basPurorgList = (params?: BasPurorg | any) =>
  defHttp.get<BasPurorg>({ url: adminPath + '/bas/purorg/basPurorg/list', params });

export const basPurorgListData = (params?: BasPurorg | any) =>
  defHttp.post<Page<BasPurorg>>({ url: adminPath + '/bas/purorg/basPurorg/listData', params });

export const basPurorgForm = (params?: BasPurorg | any) =>
  defHttp.get<BasPurorg>({ url: adminPath + '/bas/purorg/basPurorg/form', params });

export const basPurorgSave = (params?: any, data?: BasPurorg | any) =>
  defHttp.postJson<BasPurorg>({ url: adminPath + '/bas/purorg/basPurorg/save', params, data });

export const basPurorgDelete = (params?: BasPurorg | any) =>
  defHttp.get<BasPurorg>({ url: adminPath + '/bas/purorg/basPurorg/delete', params });

export const basPurorgTreeData = (params?: any) =>
  defHttp.get<TreeDataModel[]>({ url: adminPath + '/bas/purorg/basPurorg/treeData', params });
